#include "_commen.hpp"

int main()
{
    // 不用创建文件，直接通信
    char _buf[NUM] = {0};
    int wm = open(fifoname.c_str(), O_WRONLY);
    ssize_t _num = write(wm, _buf, sizeof(_buf));
    if (wm < 0)
    {
        cout << "error:" << errno << ":" << strerror(errno) << endl;
        return 2;
    }
    while (true)
    {
        system("stty raw");
        int c = getchar();
        system("stty -raw");
        ssize_t n=write(wm,(char*)&c,sizeof(char));
        assert(n);
        (void)n;

    }
    close(wm);
    return 0;
}